const passDic = [
  {
    label: "合格",
    value: "1"
  },
  {
    label: "不合格",
    value: "0"
  }
];
import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
let now = new Date();
now.setDate(now.getDate() + 1);
export const endDate = dateFormat(now, 'yyyy-MM-dd');
export const tableOption = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  dialogWidth: "70%",
  delBtn: false,
  viewBtn: false,
  showClomnuBtn: false,
  searchSize: "mini",
  labelWidth: 120,
  selection: true,
  editBtn: false,
  column: [
    {
      label: "标识",
      prop: "id",
      hide: true,
      display: false
    },
    {
      label: "测试车间/室",
      prop: "testWorkshop",
      type: "select",
      dicUrl: "/admin/dict/type/test_workshop",
      hide: true,
      rules: [
        {
          required: true,
          message: "请选择清洗票种",
          trigger: "blur"
        }
      ]
    },
    {
      label: "测试时间",
      prop: "testSubmitTime",
      type: "datetime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [
        {
          required: true,
          message: "请输入测试时间",
          trigger: "blur"
        }
      ]
    },
    {
      type: "date",
      label: "测试时间",
      prop: "testSubmitTimeDTO",
      format: "yyyy-MM-dd",
      valueFormat: "yyyy-MM-dd",
      search: true,
      hide: true,
      showColumn: false,
      display: false,
      searchValue: [startDate, endDate],
      searchRange: true,
      searchSpan: 12
    },
    {
      label: "票卡介质",
      prop: "ticketMedium",
      type: "select",
      dicUrl: "/admin/dict/type/ticket_medium",
      rules: [
        {
          required: true,
          message: "票卡介质",
          trigger: "blur"
        }
      ]
    },
    {
      label: "票种",
      prop: "ticketType",
      search: true,
      type: "select",
      dicUrl: "/support/swpmticketcardtype/dict",
      props: {
        label: "mainName",
        value: "mainEnName"
      },
      cascaderItem: ["ticketName"],
      rules: [
        {
          required: true,
          message: "请选择清洗票种",
          trigger: "blur"
        }
      ]
    },
    {
      label: "票卡名称",
      prop: "ticketName",
      type: "select",
      props: {
        label: "subName",
        value: "subEnName"
      },
      dicUrl: "/support/swpmticketcardtypeparam/dictAll/{{key}}",
      search: true,
      dicFlag: false,
      rules: [
        {
          required: true,
          message: "请选择车票名称",
          trigger: "blur"
        }
      ]
    },
    {
      label: "测试票卡数量",
      prop: "ticketNumber",
      type: "number",
      precision: 0,
      rules: [
        {
          required: true,
          message: "测试票卡数量",
          trigger: "blur"
        }
      ]
    },
    {
      label: "测试原因",
      prop: "testReason",
      rules: [
        {
          required: true,
          message: "请输入测试原因",
          trigger: "blur"
        }
      ]
    },
    {
      label: "测试人",
      prop: "testPerson",
      type: "select",
      search: true,
      component: "user-select",
      params: {
        userCodeKey: "testPersonId"
      },
      rules: [
        {
          required: true,
          message: "测试人",
          trigger: "blur"
        }
      ]
    },
    {
      type: "select",
      label: "审批状态",
      prop: "checkStatus",
      search: true,
      dicUrl: "/admin/dict/type/st_sw_tk_official_ticket_product_audit",
      addDisplay: false,
      editDisplay: false,
      searchValue: '0'
    },
    {
      label: "选择测试项目",
      prop: "listItemIds",
      type: "checkbox",
      formslot: true,
      value: [],
      span: 24,
      hide: true
    },
    {
      label: "测试结果",
      prop: "testResult",
      dicData: passDic,
      rules: [
        {
          required: true,
          message: "请输入测试结果",
          trigger: "blur"
        }
      ],
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false
    },
    {
      label: "测试提交人",
      prop: "testSubmiterId",
      type: "select",
      dicUrl: "/admin/user/page",
      props: {
        label: "nikename",
        value: "userCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        belongToLine: true
      },
      rules: [
        {
          required: true,
          message: "请输入测试提交人",
          trigger: "blur"
        }
      ],
      display: false
    },
    {
      label: "测试提交时间",
      prop: "testTime",
      type: "datetime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [
        {
          required: true,
          message: "请输入测试提交时间",
          trigger: "blur"
        }
      ],
      display: false
    },
    {
      label: "备注",
      prop: "remark",
      type: "textarea",
      maxRows: 6,
      minRows: 4,
      span: 24,
      addDisplay: false,
      editDisplay: false
    },
    {
      label: "操作人",
      prop: "operatorId",
      hide: true,
      display: false
    },
    {
      label: "创建人ID",
      prop: "creatorId",
      hide: true,
      display: false
    },
    {
      label: "创建人名称",
      prop: "creatorName",
      hide: true,
      display: false
    },
    {
      label: "创建时间",
      prop: "createtime",
      hide: true,
      display: false
    }
  ]
};


export const tableOptionView = {
  align: "center",
  labelWidth: 150,
  detail: true,
  submitBtn: false,
  emptyBtn: false,
  column: [
    {
      label: "标识",
      prop: "id",
      display: false
    },
    {
      label: "测试车间/室",
      prop: "testWorkshop",
      type: "select",
      dicUrl: "/admin/dict/type/test_workshop"
    },
    {
      label: "测试时间",
      prop: "testSubmitTime",
      type: "datetime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss"
    },
    {
      type: "date",
      label: "测试时间",
      prop: "testSubmitTimeDTO",
      format: "yyyy-MM-dd",
      valueFormat: "yyyy-MM-dd"
    },
    {
      label: "票卡介质",
      prop: "ticketMedium",
      type: "select",
      dicUrl: "/admin/dict/type/ticket_medium"
    },
    {
      label: "票种",
      prop: "ticketType",
      type: "select",
      dicUrl: "/support/swpmticketcardtype/dict",
      props: {
        label: "mainName",
        value: "mainEnName"
      },
      cascaderItem: ["ticketName"]
    },
    {
      label: "票卡名称",
      prop: "ticketName",
      type: "select",
      props: {
        label: "subName",
        value: "subEnName"
      },
      dicUrl: "/support/swpmticketcardtypeparam/dictAll/{{key}}",
      dicFlag: false
    },
    {
      label: "测试票卡数量",
      prop: "ticketNumber",
      type: "number",
      precision: 0
    },
    {
      label: "测试原因",
      prop: "testReason"
    },
    {
      label: "测试人",
      prop: "testPerson",
      type: "select",
      component: "user-select",
      params: {
        userCodeKey: "testPersonId"
      }
    },
    {
      type: "select",
      label: "审批状态",
      prop: "checkStatus",
      dicUrl: "/admin/dict/type/st_sw_tk_official_ticket_product_audit"
    },
    {
      label: "测试提交人",
      prop: "testSubmiterId",
      type: "select",
      dicUrl: "/admin/user/page",
      props: {
        label: "nikename",
        value: "userCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        belongToLine: true
      }
    },
    {
      label: "测试提交时间",
      prop: "testTime",
      type: "datetime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss"
    },
    {
      label: "备注",
      prop: "remark",
      type: "textarea",
      span: 24
    },
  ]
};


export const resultFormOptionView = {
  align: "center",
  labelWidth: 150,
  detail: true,
  submitBtn: false,
  emptyBtn: false,
  column: [
    {
      label: "票卡外观测试",
      prop: "testAppearance",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡读写高度测试",
      prop: "testRwheight",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡ES编码测试",
      prop: "testEs",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡各类查询测试",
      prop: "testSearch",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡走票性能测试",
      prop: "testPassperfor",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡补票性能测试",
      prop: "testAdd",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡发售测试",
      prop: "testSell",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "测试人",
      prop: "testPersonCode",
      type: "select",
      dicUrl: "/admin/user/page",
      props: {
        label: "nikename",
        value: "userCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        belongToLine: true
      },
      disabled: true,
      display: false
    },
    {
      label: "最终测试结论",
      prop: "testResult",
      type: "select",
      dicData: passDic
    },
    {
      label: "备注",
      prop: "remark",
      type: "textarea",
      span: 24
    }
  ]
};

export const resultFormOption = {
  menuBtn: false,
  labelWidth: 150,
  column: [
    {
      label: "票卡外观测试",
      prop: "testAppearance",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡读写高度测试",
      prop: "testRwheight",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡ES编码测试",
      prop: "testEs",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡各类查询测试",
      prop: "testSearch",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡走票性能测试",
      prop: "testPassperfor",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡补票性能测试",
      prop: "testAdd",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "票卡发售测试",
      prop: "testSell",
      type: "select",
      dicData: passDic,
      display: false
    },
    {
      label: "测试人",
      prop: "testPersonCode",
      type: "select",
      dicUrl: "/admin/user/page",
      props: {
        label: "nikename",
        value: "userCode",
        res: "data.records"
      },
      dicQuery: {
        size: -1,
        belongToLine: true
      },
      disabled: true,
      display: false
    },
    {
      label: "最终测试结论",
      prop: "testResult",
      type: "select",
      dicData: passDic
    },
    {
      label: "备注",
      prop: "remark",
      type: "textarea",
      span: 24
    }
  ]
};
